package nccloud.web.hrppl.proupdate.proupdatehvo.action;
import java.util.HashMap;
import java.util.Map;

import nc.itf.hrppl.proupdate.proupdatehvo.IProUpdateHVOService;
import nc.pub.billcode.vo.BillCodeContext;
import nc.vo.hrppl.proupdate.AggProUpdateHVO;
import nccloud.framework.service.ServiceLocator;
import nccloud.framework.web.container.IRequest;
import nccloud.framework.web.ui.pattern.extbillcard.ExtBillCard;
import nccloud.web.codeplatform.framework.action.base.BaseAction;
import nccloud.web.codeplatform.framework.action.base.RequestDTO;
import nccloud.web.codeplatform.framework.action.base.RequstParamWapper;
import nccloud.web.codeplatform.framework.action.base.ResultWapper;
import nccloud.web.codeplatform.framework.action.base.VOTransform;
import nccloud.web.hrppl.pjapplication.pjappl.action.TranslateActionUtil;

/**
 * 编辑Action
 */
public class EditProUpdateHVOAction extends BaseAction{
	@Override
	public Object doAction(IRequest request, RequstParamWapper paramWapper) throws Throwable{
		//json数据转换
		RequestDTO param = VOTransform.toVO(paramWapper.requestString,RequestDTO.class);
		//获取参数
		String pk = param.getPk();
		
		IProUpdateHVOService service = ServiceLocator.find(IProUpdateHVOService.class);
		
		AggProUpdateHVO vo = service.preEditAggProUpdateHVO(pk);
		
		if(vo == null){
			return null;
		}
		Map<String,Object> externalData = new HashMap<>();
		BillCodeContext context = service.getBillCodeContext("hrpplproupdate");
		externalData.put("billCodeContext",context);
		Object data = buildResult(param,true,externalData,vo);
	    //start modify by wy at 2024年7月26日
		ResultWapper o = (ResultWapper) data;
		ExtBillCard billcard = (ExtBillCard) o.getData();
		TranslateActionUtil.translateAggvoVO(billcard,"CGUpdateCVOSub");
		return data;
	}
	
}